// var baseUrl ="http://10.43.10.105:8089/containeryard";//涛
var baseUrl ="http://test.oneconn.com/containeryard2";


function getDCXHMX() //箱子数据
{
    //var url1="dataio/DataIOHttpService/Handler.ashx?func=getdata&userno=TOS_JK01&md5str=8A509B274E195EF561523B38798DA1B9&  &dataname=JKlogin"
   
    // var url1 ="data/dcxwmx.json";
    // var vdata="";
    // console.log(url1);
    // $.ajaxSettings.async = false;
    // $.getJSON(url1, function(data){
    //     console.log(data); ////
    // vdata=data.Rows;
    // console.log(vdata);
    // });

    var url1 =baseUrl+"/model/getAllContainerPostition";
    var vdata="";
    // console.log(url1);
    $.ajaxSettings.async = false;
    $.getJSON(url1, function(data){
    vdata=data.data;
    // console.log(data);///

    console.log(123);
    console.log(vdata);

    });

    return vdata;
}

function getQHDY()
{
    //var url1="dataio/DataIOHttpService/Handler.ashx?func=getdata&userno=TOS_JK01&md5str=8A509B274E195EF561523B38798DA1B9&wherestr='select DJLSH, QYDM,QY,QH,BWS,PS,CS,ZBX,ZBY,height,Width,PHQD,BHQD from QHDYH' &dataname=GetExecSql"
    var url1="data/qhdyh.json";
    var vdata="";
    // console.log(url1);
    $.ajaxSettings.async = false;
    $.getJSON(url1, function(data){
    
    vdata=data;

    });

    return vdata;
}


function GetRowColByDCXWMX (QHDYH,dcxwmx)
{

    var bei=parseInt(dcxwmx.BHDM); //贝 X col 列
    var pai=parseInt(dcxwmx.PHDM); //排 Y row 行
    // var ceng=parseInt(dcxwmx.CHDM)-80; 
    var ceng=parseInt(dcxwmx.CHDM); 
    var bws=parseInt(QHDYH.BWS)
    var ps=parseInt(QHDYH.PS)
    var x;
    var y=pai;
    var isbig = false;

    if (bei % 2 == 0)
    {
        isbig = true;
    }

    if (QHDYH.BHQD == "从西到东")
    {
        if (isbig)
            bei = bei - 1;
        x = (bei + 1) / 2;
    }
    else
    {
        if (isbig)
            bei = bei + 1;
        x = (bws + 2 - bei) / 2;

    }

    if (QHDYH.PHQD == "从南到北")
    {
        y = ps + 1 - pai;
    }


     return {
         row:y,
         col:x,
         ceng:ceng
        };
}
